package com.jy.api.signUpReq.pos;

import com.jy.api.domain.Order;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * Created by xiaohua on 2019/3/13.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SubOrderRes {

    private String seat;

    private Date orderTime;

    private String empName;

    private double total;

    private double discount;

    private double removeZero;

    private double amount;

    private List<items> items;

    private String id;

    private int count;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class items {
        private String productId;

        private int spec;

        private String productName;

        private boolean kitchenPrintEnabled;

        private int quantity;

        private double amount;

        private boolean enabled = true;

        private boolean finish;

        private String ipAddress;

        private int port;
    }


    public SubOrderRes(Order order) {
        this.seat = order.getPartitionName() + "--" + order.getNumName();
        this.orderTime = order.getAddTime();
        this.empName = order.getCreatorName();
        this.total = order.getTotal();
        this.discount = order.getDiscount();
        this.removeZero = order.getRemoveZero();
        this.amount = order.getAmount();
        this.id = order.getId();
        this.count = order.getCount();
    }
}
